import yaml
from config.config import base_path


class ReadConfig():
    @staticmethod
    def parse_yaml( filepath=base_path, filename='', key=''):
        with open(filepath + filename, "r", encoding="utf-8") as f:
            data = yaml.load(f, Loader=yaml.FullLoader)
            keys = key.split(".")
            for k in keys:
                data = data[k]
            return data
if __name__ == '__main__':
    value = ReadConfig.parse_yaml(filename='config/appconfig.yaml',key='base.ANDROID_CAPA')
    print(value)